package com.example.booksshop.service.imp;
import com.example.booksshop.entity.Book;
import com.example.booksshop.entity.BookCategory;
import com.example.booksshop.mapper.BookMapper;
import com.example.booksshop.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xuan 2021/9/15
 */
@Service
public class BookServiceImpl implements BookService {
   @Autowired
   BookMapper bookMapper;
   @Override
   public void bookInsert(String bookname, String author, Integer cid) {
      bookMapper.bookInsert(bookname, author, cid);
   }

   @Override
   public List<BookCategory> showBooks() {
      return bookMapper.showBooks();
   }

   @Override
   public BookCategory selectBook(String bookname) {
      return bookMapper.selectBook(bookname);
   }
   @Override
   public void deleteBook(String bookname) {
      bookMapper.deleteBook(bookname);
   }
   @Override
   public List<BookCategory> categoryBook(String category) {
      return bookMapper.categoryBook(category);
   }
   @Override
   public void updateBook(Book book) {
      bookMapper.updateBook(book);
   }
}
